% When using scripts, keep the following directories up to date:
% change the directories if necessary
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Analysis destination directory. This must be same as
% specified in the parameter file.
analysisDestinationPath = '/share/sig_pic/kauppij/fMRI_iiro/ISCresults5/';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Directory of the templates:
% **********************
templatePath = '/share/sig_pic/kauppij/fMRI_iiro/ISCtoolbox/templates/';
% Directory of the codes for running the ISC analysis:
ISCanalysisPath = '/share/sig_pic/kauppij/fMRI_iiro/ISCtoolbox/ISCanalysis/';
% Directory of the codes to process nifti -files:
niftiPath = '/share/sig_pic/kauppij/fMRI_iiro/ISCtoolbox/niftitools/';
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%









%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% do not edit:

% set path:
P=path;
P=path(P,ISCanalysisPath);
P=path(P,analysisDestinationPath);
P=path(P,niftiPath);
P=path(P,templatePath);

% load parameters from the destination directory. 
% Then you can run analysis by typing: runAnalysis(Params).
try
  load([analysisDestinationPath 'Tag'])
  load([analysisDestinationPath Tag '.mat'])
  whos
  catch
    disp('Existing parameters not found, creating new ones using initParams...')
    cd(ISCanalysisPath)
    Params = initParams(templatePath,analysisDestinationPath);
end
